Vue.filter("setDate", function(value) {
  Date.prototype.toLocaleString = function() {
    return this.getFullYear() + "年" + ((this.getMonth() >= 1 && this.getMonth() <= 9) ? "0" + this.getMonth():this.getMonth()) + "月" + ((this.getDate() >= 1 && this.getDate() <= 9) ? "0" + this.getDate():this.getDate()) + "日 ";
  };
  var unixTimestamp = new Date(value) ;
  return unixTimestamp.toLocaleString();
});

Vue.filter("filterGetDate", function(value) {
  if(value && value >= 0){
    Date.prototype.toLocaleString = function() {
      return this.getFullYear() + "-" + ((this.getMonth()+1 >= 1 && this.getMonth()+1 <= 9) ? "0" + (this.getMonth()+1):this.getMonth()+1)
    };
    var unixTimestamp = new Date(value) ;
    return unixTimestamp.toLocaleString();
  }else{
    return '-';
  }
});
Vue.filter("filterGetDateForDay", function(value) {
  Date.prototype.toLocaleString = function() {
    return this.getFullYear() + "-" + ((this.getMonth()+1 >= 1 && this.getMonth()+1 <= 9) ? "0" + this.getMonth()+1:this.getMonth()+1) + "-" +((this.getDate() >= 1 && this.getDate() <= 9) ? "0" + this.getDate():this.getDate())
  };
  var unixTimestamp = new Date(value) ;
  return unixTimestamp.toLocaleString();
});

Vue.filter("filterImageName", function(value) {
  switch(value)
    {
    case 'vin':
      return 'VIN';
      break;
    case 'right_rear':
      return '右后';
      break;
    case 'driving_seat':
      return '驾驶座椅';
      break;
    case 'control_booth':
      return '控制室';
      break;
    case 'odograph':
      return '里程表';
      break;
    case 'left_anterior':
      return '左前（首图）';
      break;
    case 'open_trunk':
      return '打开后备箱';
      break;
    case 'engine_bay':
      return '发动机全景';
      break;
    case 'right_side':
      return '右侧';
      break;
    case 'tyre':
      return '轮胎';
      break;
    case 'insurance':
      return '保单';
      break;
    case 'registration_license':
      return '登记证';
      break;
    case 'vehicle_license':
      return '行驶证';
      break;
    default:
      return '无';
      break;
    }
});
Vue.filter("filterCarStockState", function(value) {
  switch(value)
    {
    case 0:
      return '已入库';
      break;
    case 1:
      return '出库中';
      break;
    case 2:
      return '已出库';
      break;
    default:
      return '无';
      break;
    }
});

Vue.filter("filterCarDetectState", function(value) {
  switch(value)
    {
    case 0:
      return '未检测';
      break;
    case 1:
      return '检测中';
      break;
    case 2:
      return '检测完毕';
      break;
    default:
      return '无';
      break;
    }
});
Vue.filter("filterCarSaleState", function(value) {
  switch(value)
    {
    case 0:
      return '未上架';
      break;
    case 10:
      return '上架中';
      break;
    case 20:
      return '已上架';
      break;
    case 30:
      return '已下架';
      break;
    default:
      return '无';
      break;
    }
});
Vue.filter("filterCarAuthState", function(value) {
  switch(value)
    {
    case 0:
      return '未认证';
      break;
    case 1:
      return '已认证';
      break;
    default:
      return '无';
      break;
    }
});
Vue.filter("filterCarOrderState", function(value) {
  switch(value)
    {
    case 0:
      return '未预订';
      break;
    case 1:
      return '已预订';
      break;
    default:
      return '无';
      break;
    }
});
Vue.filter("filterCar4sUpkeepState", function(value) {
  switch(value)
    {
    case 0:
      return '不是';
      break;
    case 1:
      return '是';
      break;
    default:
      return '不是';
      break;
    }
});

Vue.filter("filterCarTransferState", function(value) {
  switch(value)
    {
    case 0:
      return '不包含过户费';
      break;
    case 1:
      return '包含过户费';
      break;
    default:
      return '不包含过户费';
      break;
    }
});
Vue.filter("filterCarFixedPriceState", function(value) {
  switch(value)
    {
    case 0:
      return '非一口价';
      break;
    case 1:
      return '一口价';
      break;
    default:
      return '非一口价';
      break;
    }
});
Vue.filter("filterCarMortgageState", function(value) {
  switch(value)
    {
    case 0:
      return '否';
      break;
    case 1:
      return '是';
      break;
    default:
      return '否';
      break;
    }
});









